package com.example.a14874.service;

import android.os.Binder;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MyBinder extends Binder{
    public int add(int a,int b){
        return a+b;
    }
//显示时间
    public String getTime(){
        Date date =new Date(  );
        SimpleDateFormat format=new SimpleDateFormat( "yyyy-MM-dd hh:mm:ss" );
        return format.format( date );
    }
    //字符串单词逆序
    private static String reverse(String str){
        String[] words=str.split( " " );
        StringBuffer buffer = new StringBuffer(  );
        for(String word : words){
            StringBuffer wordBuffer = new StringBuffer( word );
            buffer.append( wordBuffer.reverse() ).append( "" );
        }
        return buffer.toString();
    }
}
